export default {
  state: {
    contents: [
      {
        type: 'GPT',
        name: "Message",
        options: {
          message: 'Welcome to MSPbots AI! How can I assist you today?'
        },
      },
      {
        type: 'GPT',
        name: "Dataset",

      },
    ],
    loading: false,
    prepareWidget:null
  },
  mutations: {
    SET_CONTENT (state, content) {
      state.contents = [...state.contents, content]
    },
  },
  actions: {

  },
  getters: {
    __contents (state) {
      return state.contents.filter(content => content.type === 'GPT').map(({ type, ...content }) => content)
    },
    dataset (state) {
      return state.contents.findLast(content => content.dataset)
    }
  }
}
